import {get, post} from "./http.js";

export const queryNewsLatest = () => get('/api/story/news_latest')
export const queryNewsBefore = (time) => get(`/api/story/news_before`, {time})

export const queryNewsInfo = (id) => get(`/api/story/news_info`, {id})

export const queryStoryExtra = (id) => get(`/api/story/story_extra`, {id})

export const queryStore = (id) => post(`/api/user/store`, {id})
export const delStore = (id) => post(`/api/user/remove_store`, {id})
export const queryStoreList = () => get(`/api/user/store_list`)
export const queryUserInfo = () => get(`/api/user/user_info`)
export const queryUserUpdate = (data) => post(`/api/user/user_update`, data)
export const upload = (data) => post('/api/upload', data)

export const queryCode = (phone) => post('/api/user/phone_code', {phone})
export const queryLogin = ({phone, code}) => post('/api/auth/login', {phone, code})